package com.tiantai.system.service.impl;

import java.util.List;
import com.tiantai.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.tiantai.system.mapper.TeaPreventionMapper;
import com.tiantai.system.domain.TeaPrevention;
import com.tiantai.system.service.ITeaPreventionService;

/**
 * 虫情防治措施Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-21
 */
@Service
public class TeaPreventionServiceImpl implements ITeaPreventionService 
{
    @Autowired
    private TeaPreventionMapper teaPreventionMapper;

    /**
     * 查询虫情防治措施
     * 
     * @param id 虫情防治措施主键
     * @return 虫情防治措施
     */
    @Override
    public TeaPrevention selectTeaPreventionById(Long id)
    {
        return teaPreventionMapper.selectTeaPreventionById(id);
    }

    /**
     * 查询虫情防治措施列表
     * 
     * @param teaPrevention 虫情防治措施
     * @return 虫情防治措施
     */
    @Override
    public List<TeaPrevention> selectTeaPreventionList(TeaPrevention teaPrevention)
    {
        return teaPreventionMapper.selectTeaPreventionList(teaPrevention);
    }

    /**
     * 新增虫情防治措施
     * 
     * @param teaPrevention 虫情防治措施
     * @return 结果
     */
    @Override
    public int insertTeaPrevention(TeaPrevention teaPrevention)
    {
        teaPrevention.setCreateTime(DateUtils.getNowDate());
        return teaPreventionMapper.insertTeaPrevention(teaPrevention);
    }

    /**
     * 修改虫情防治措施
     * 
     * @param teaPrevention 虫情防治措施
     * @return 结果
     */
    @Override
    public int updateTeaPrevention(TeaPrevention teaPrevention)
    {
        teaPrevention.setUpdateTime(DateUtils.getNowDate());
        return teaPreventionMapper.updateTeaPrevention(teaPrevention);
    }

    /**
     * 批量删除虫情防治措施
     * 
     * @param ids 需要删除的虫情防治措施主键
     * @return 结果
     */
    @Override
    public int deleteTeaPreventionByIds(Long[] ids)
    {
        return teaPreventionMapper.deleteTeaPreventionByIds(ids);
    }

    /**
     * 删除虫情防治措施信息
     * 
     * @param id 虫情防治措施主键
     * @return 结果
     */
    @Override
    public int deleteTeaPreventionById(Long id)
    {
        return teaPreventionMapper.deleteTeaPreventionById(id);
    }
}
